<template>
  <div class="card">
    <div v-if="$slots.header" class="card-header">
      <slot name="header" />
    </div>
    
    <div v-if="$slots.default" class="card-content">
        {{ message }}
      <slot />
    </div>
    
    <div v-if="$slots.footer" class="card-footer">
      <slot name="footer" :data="stu" />
    </div>
  </div>
</template>

<script>
export default {
  inject: ['message'],
  name: "Slot2",
  data() {
    return {
        stu: {
            name: '张三', age: 18
        }
    };
  }
};
</script>

<style scoped>
</style>
